#  栈：先进后出
# 类似于：箱子（拿东西和放东西）

class Stack:
    def __init__(self):
        self.items = []

    def isEmpty(self):  # 判栈空
        return self.items == []

    def push(self, item):  # 进栈
        self.items.append(item)

    def pop(self):  # 出栈
        return self.items.pop()

    def peek(self):  # 获取栈顶元素
        return self.items[len(self.items) - 1]

    def size(self):  # 获取栈的大小
        return len(self.items)


# 十进制转二进制
def Switch(Number):
    switch = Stack()
    while Number > 0:
        num = Number % 2
        switch.push(num)
        Number = Number // 2

    # 构建二进制字符串
    binStr = ''

    while not switch.isEmpty():
        binStr = binStr + str(switch.pop())
    return "0b" + binStr


print(Switch(int(input("请输入要转换成二进制的数字： "))))
